package com.springcloud.tools.controller;

import com.springcloud.tools.annotation.AutoIdempotent;
import com.springcloud.tools.token.TokenService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author fuc
 * @create 2020-08-19
 */
@RestController
public class TestController {

  @Autowired TokenService tokenService;

  @GetMapping("/getToken")
  public String getToken() {
    return tokenService.createToken();
  }

  @PostMapping("/hello")
  @AutoIdempotent
  public String hello() {
    return "hello";
  }

  @PostMapping("/hello2")
  public String hello2() {
    return "hello";
  }
}
